package zoo.member.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

public class LogonCheckInterceptor extends HandlerInterceptorAdapter{
	
	public boolean preHandle(HttpServletRequest request, 
			HttpServletResponse response, 
			Object handler)throws Exception{

		
		System.out.println("Interceptor 진입");
		
		//session 호출
		HttpSession session = request.getSession();
		
		String userId = (String)session.getAttribute("userid");
		if(userId == null){
			response.sendRedirect("../main/memberlogin.do");
			return false;
		}
		return true;
	}
}
